<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JS的字符串</title>
</head>
<body>
<script>
    // 字符串创建方式一: let 变量名 = new String(s);
    let str1 = new String("你好");
    document.write(str1+"<br/>");
    //字符串创建方式二: let 变量名 = "内容";
    let str2 = "hello";
    document.write(str2+"<br/>");
    // 字符串的长度: length
    document.write(str2.length+"<br/>");
    // trim(): 去除字符串前后两端的空白字符
    var str4 = '  ab c   ';
    document.write(str4.trim()+"<br/>");
</script>
</body>
</html>